import Vue from 'vue'
import VueRouter from 'vue-router'

import Index from '../views/Index.vue'
import Home from '../views/Home.vue'
import Support from '../views/Support/Support.vue'

import Hospital from '../views/Hospital/Hospital.vue'
import HospitalHome from '../views/Hospital/HospitalHome'
import HospitalNotice from '../views/Hospital/HospitalHome'
import HospitalSuspend from '../views/Hospital/HospitalHome'
import HospitalQuery from '../views/Hospital/HospitalHome'
import HospitalOrder from '../views/Hospital/HospitalHome'

import Personal from '../views/Personal/Personal.vue'
import PersonalName from '../views/Personal/PersonalName.vue'
import PersonalOrder from '../views/Personal/PersonalOrder.vue'
import PersonalPatient from '../views/Personal/PersonalPatient.vue'
import PersonalAccount from '../views/Personal/PersonalAccount.vue'

import NucleicCheck from '../views/NucleicCheck/NucleicCheck.vue'
import Department from '../views/Department/Department.vue'
import DepartmentSearch from '../views/DepartmentSearch/DepartmentSearch.vue'
import PlatformNotice from '../views/PlatformNotice/PlatformNotice.vue'
import SuspendNotice from '../views/SuspendNotice/SuspendNotice.vue'
import PlatformNoticeDetail from '../views/PlatformNotice/PlatformNoticeDetail'
import SuspendNoticeDetail from '../views/SuspendNotice/SuspendNoticeDetail'
Vue.use(VueRouter)

const routes = [{
        path: '/',
        name: 'Index',
        component: Index,
        redirect: 'home',
        children: [{
                path: 'home',
                name: 'home',
                component: Home
            },
            {
                path: '/platform-notice',
                name: 'platform-notice',
                component: PlatformNotice,
                children: [{
                    path: ':id',
                    name: 'platform-notice-detail',
                    component: PlatformNoticeDetail
                }]
            }, {
                path: '/suspend-notice',
                name: 'suspend-notice',
                component: SuspendNotice,
                children: [{
                    path: ':id',
                    name: 'suspend-notice-detail',
                    component: SuspendNoticeDetail
                }]
            },
            {
                path: '/support',
                name: 'support',
                component: Support
            },
            {
                path: '/department-search/:id',
                name: 'department-search',
                component: DepartmentSearch
            },
            {
                path: '/nucleicCheck',
                name: 'nucleicCheck',
                component: NucleicCheck
            },
            {
                path: '/department',
                name: 'department',
                component: Department
            },
            {
                //用户信息中心
                path: '/personal',
                name: 'personal',
                component: Personal,
                children: [{
                        path: 'real-name',
                        name: 'real-name',
                        component: PersonalName
                    },
                    {
                        path: 'order',
                        name: 'order',
                        component: PersonalOrder
                    },
                    {
                        path: 'patient',
                        name: 'patient',
                        component: PersonalPatient
                    },
                    {
                        path: 'account',
                        name: 'account',
                        component: PersonalAccount
                    },
                ]
            },

            {
                // 医院路由
                path: 'hospital/:userId/',
                name: 'hospital',
                component: Hospital,
                children: [
                    // {
                    //     path: 'detail',
                    //     name: 'detail',
                    //     component: Detail
                    // },
                    {
                        path: 'home',
                        name: 'home',
                        component: HospitalHome
                    },
                    {
                        path: 'notice',
                        name: 'notice',
                        component: HospitalNotice
                    },
                    {
                        path: 'suspend',
                        name: 'suspend',
                        component: HospitalSuspend
                    },
                    {
                        path: 'query',
                        name: 'query',
                        component: HospitalQuery
                    },
                    {
                        path: ':id',
                        name: 'order',
                        component: HospitalOrder
                    }
                ]
            }
        ]
    },
    {
        path: '/about',
        name: 'About',
        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () =>
            import ( /* webpackChunkName: "about" */ '../views/About.vue')
    },



]

const router = new VueRouter({
    routes
})

export default router